prefix in python

38

line = 'Please have a nice day.'
print(line.startswith('Please'))        # Output: True
# Remember it is case-sensitive
print(line.startswith('p'))             # Output: False

Comments

Submit
0 Comments